#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdbool.h>

bool ex(int x)
{
    for (int i = 2; i * i <= x; ++i)
    {
        if (x % i == 0)
            return false;
    }
    return true;
}


int countPrimes(int n)
{
    int ret = 0;
    for (int i = 2; i < n; i++)
    {
        ret += ex(i);
    }
    return ret;
}